<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class SCloudLessonInfo extends Model
{
    //
    //
    use SoftDeletes;
    public $table = "s_cloud_lesson_info";

    protected $fillable = [
        // 'name', 'pic_type', 'pic_url', 'to_url', 'course_type', 'admin_id', 'created_at'
    ];

    public function adminUser()
    {
        return $this->belongsTo('App\Models\AdminUsers', 'admin_id');
    }

    //云课堂列表
    static public function getList($limit=3)
    {
        return self::select('id', 'title', 'tags', 'is_free', 'is_recommend', 'poster', 'base_num', 'look_num', 'created_at' )->where('on_sale', 1)->orderBy("id", "desc")->limit($limit)->get();
    }
}
